﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Wicresoft.EKA.BOSync
{
    public class IncidentService : AbstractService<TB_INCIDENT_TEMP>
    {
        IDB dbHelper = new OracleDBHelper(ConfigurationManager.ConnectionStrings["BOConnection"].ConnectionString);

        public override void ImportData(IList<TB_INCIDENT_TEMP> list,IDB db)
        {
            foreach (var item in list)
            {
                int id = 0;
                int.TryParse(db.ExecuteScalar("select Tb_Incident_Temp_Seq.nextval from sys.dual"), out id);
                item.Id = id;
            }
            base.ImportData(list,db);
        }
        public override void SyncData()
        {
            dbHelper.ExecuteStoredProcedure("usp_sync_incident");
        }
    }
}
